package com.ztesoft.report.entity;

import java.io.Serializable;

import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.ztesoft.report.base.entity.BaseEntity;

/**
 * <p>
 * SQL配置
 * </p>
 *
 * @author y3tu
 * @since 2018-06-14
 */
@TableName("sys_sql")
public class SysSql extends BaseEntity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * SQL编码
     */
    @TableId("sql_code")
	private String sqlCode;
    /**
     * 名称
     */
	@TableField("sql_name")
	private String sqlName;
    /**
     * SQL内容。查询返回字段必须是
     */
	@TableField("sql_text")
	private String sqlText;
    /**
     * 值字段
     */
	@TableField("value_col")
	private String valueCol;
    /**
     * 名称字段
     */
	@TableField("name_col")
	private String nameCol;
    /**
     * 行数
     */
	@TableField("max_rows")
	private Integer maxRows;
    /**
     * 描述
     */
	private String remarks;
    /**
     * 创建人
     */
	@TableField("create_by")
	private String createBy;
    /**
     * 创建时间
     */
	@TableField("create_date")
	private Date createDate;
    /**
     * 更新人
     */
	@TableField("update_by")
	private String updateBy;
    /**
     * 更新时间
     */
	@TableField("update_date")
	private Date updateDate;
    /**
     * 删除标识。1：正常，0：禁用
     */
	private Integer status;
    /**
     * 数据源id 关联datasource表
     */
	@TableField("datasource_id")
	private Integer datasourceId;

	/**
	 * 数据源名称
	 */
	private String datasourceName;

	/**
	 * 用于修改时使用做判断条件
	 */
	private String oldSqlCode;


	public String getOldSqlCode() {
		return oldSqlCode;
	}

	public void setOldSqlCode(String oldSqlCode) {
		this.oldSqlCode = oldSqlCode;
	}

	public String getDatasourceName() {
		return datasourceName;
	}

	public void setDatasourceName(String datasourceName) {
		this.datasourceName = datasourceName;
	}

	public String getSqlCode() {
		return sqlCode;
	}

	public void setSqlCode(String sqlCode) {
		this.sqlCode = sqlCode;
	}

	public String getSqlName() {
		return sqlName;
	}

	public void setSqlName(String sqlName) {
		this.sqlName = sqlName;
	}

	public String getSqlText() {
		return sqlText;
	}

	public void setSqlText(String sqlText) {
		this.sqlText = sqlText;
	}

	public String getValueCol() {
		return valueCol;
	}

	public void setValueCol(String valueCol) {
		this.valueCol = valueCol;
	}

	public String getNameCol() {
		return nameCol;
	}

	public void setNameCol(String nameCol) {
		this.nameCol = nameCol;
	}

	public Integer getMaxRows() {
		return maxRows;
	}

	public void setMaxRows(Integer maxRows) {
		this.maxRows = maxRows;
	}

	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public String getCreateBy() {
		return createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getUpdateBy() {
		return updateBy;
	}

	public void setUpdateBy(String updateBy) {
		this.updateBy = updateBy;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Integer getDatasourceId() {
		return datasourceId;
	}

	public void setDatasourceId(Integer datasourceId) {
		this.datasourceId = datasourceId;
	}

	@Override
	protected Serializable pkVal() {
		return this.sqlCode;
	}

	@Override
	public String toString() {
		return "SysSql{" +
			", sqlCode=" + sqlCode +
			", sqlName=" + sqlName +
			", sqlText=" + sqlText +
			", valueCol=" + valueCol +
			", nameCol=" + nameCol +
			", maxRows=" + maxRows +
			", remarks=" + remarks +
			", createBy=" + createBy +
			", createDate=" + createDate +
			", updateBy=" + updateBy +
			", updateDate=" + updateDate +
			", status=" + status +
			", datasourceId=" + datasourceId +
			"}";
	}
}
